define(['egis'], function (egis) {
    Window.deserializer = Window.deserializer || new egis.core.Deserializer();
    Window.container = Window.container || {};
    dsBridge.register('create_RestDICSService', function (sourceId, url, http, authType, clientId, clientSecret,tokenUrl) {
        var restHttp = Window.container[http];
        var restGeoService = new egis.ews.RestDICSService({
            url: url,
            http: restHttp,
            deserializer: Window.deserializer,
            authType: authType,
            clientId: clientId,
            clientSecret: clientSecret,
            tokenUrl:tokenUrl
        });
        Window.container[sourceId] = restGeoService;
    })

    dsBridge.registerAsyn('RestDICSService_getTypes', function (sourceId, responseCallback) {
        var restDICSService = Window.container[sourceId];
        restDICSService.getTypes().then(function (value) {
            responseCallback(JSON.stringify(value));
        })
    })
     dsBridge.registerAsyn('RestDICSService_getValue', function (sourceId, type,code, responseCallback) {
            var restDICSService = Window.container[sourceId];
            restDICSService.getValue(type,code).then(function (value) {
                responseCallback(JSON.stringify(value));
            })
        })
      dsBridge.registerAsyn('RestDICSService_list', function (sourceId, type, responseCallback) {
             var restDICSService = Window.container[sourceId];
             restDICSService.list(type).then(function (value) {
                 responseCallback(JSON.stringify(value));
             })
         })

})